home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
301-325
/
311
/
crobots
/
thorin.r
< prev
next >
Wrap
Text File
|
1995-03-14
|
2KB
|
71 lines
Asian Spec.
Na Sy Chuang
/*thorin stoutfoot algorithm ......
charge at foe and keep charging until either you die or he does */
/* Thorin Stoutfoot (tm) is copyrighted 1981 by Na Sy Chuang
used without permission or endorsement. */
/* only one routine !! */
main()
{
int Dir,Range;
Dir=Range=0;
while (1) /* main loop */
{
drive(rand(360),100);
while (!(Range=scan(Dir,10)))
Dir += 20;
if (!speed())
while (!speed())
drive(rand(360,100));
Dir -= 20;
while (!(Range=scan(Dir,5)))
Dir += 5;
while (speed() > 49)
{
cannon(Dir,Range);
drive(Dir,0);
}
drive(Dir,100);
while (Range = scan(Dir,5))
{
while (Range = scan(Dir,5))
cannon(Dir,Range);
if (Range = scan(Dir, 10))
{
int k;
Dir -= 10;
k = Dir;
while ((!(Range = scan(Dir,5))) &&
(Dir - k <= 30))
Dir += 5; /* fine tuning */
while (speed() > 49)
drive(Dir,0);
drive(Dir, 100);
}
} /* if out of this loop? probably passed by. turn around */
Dir += 170;
while (speed() > 49)
drive(0,0);
} /* while */
}